<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="MobileOptimized" content="320" />
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/jiazai.css">
    <link rel="stylesheet" href="css/mui.min.css"/>
    <link rel="stylesheet" href="css/nitice-list.css">
    <title>通知列表</title>
</head>

<body style="background: #efeff4;">
    <div id='app'>

        <!-- 加载中动画 -->
        <div id='jiazai-ani' v-if='jiazai'>
            <div class="arc"></div>
            <h1><span>LOADING</span></h1>
        </div>
        <!-- 加载中动画 -->
		<p></p>
        <div class='notice-hea'>
            <img @tap='_close();' src="img/right-black.svg" style="width: 20px;height: 20px;" >
            <span>公告</span>
        </div>
        <div class='notice-list-wrap' id='more'>
        	<div>
        		<div id="">
        			<div class='notice-list' v-for="(val,index) in list" :key='index' @tap="goNotice(val)">
		                <h1  style='padding-top:2px;' v-text='val.title'>---</h1>
		                <p v-text='val.addtime'>2018-10-02 23:00:01</p>
		            </div>
        		</div>
        	</div>
        </div>
    </div>
    <script src="js/comm.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                //加载动画
                jiazai: false,
                //页码
                page:1,
                //通知数据
                list:[]
            },
            methods: {
            	//得到通知
            	getNotice:function(){
            		this.jiazai=true;
            		var This=this;
            		HTTP.post(GETARTICLE,{
            			pageindex:this.page++
            		},function(data){
            			This.jiazai=false;
            			for(var i=0;i<data.list.length;i++){
            				This.list.push(data.list[i]);
            			}
            			if(data.list.length<10){
                            //没有更多数据
                            mui('#more').pullRefresh().endPullupToRefresh(true);
            			}else{
            				//还有更多数据
                            mui('#more').pullRefresh().endPullupToRefresh(false);
            			}
					});
            	},
            	//去通知详情
            	goNotice:function(val){
            		var web=_openHref({
            			url:'notice-info.html',
            			id:'noticeInfo',
            			bg:'#efeff4'
            		});
            		setTimeout(function(){
            			web.evalJS("notice('"+JSON.stringify(val)+"')");	
            		},300);
            	}
            }
        });
        
    </script>
    <script type="text/javascript" charset="utf-8">
    	mui.init({
			pullRefresh: {
				container: '#more',
				up: {
					contentrefresh: '正在加载...',
					contentnomore: "暂无更多",
					auto: true, //可选,默认false.自动上拉加载一次
					callback: function(){
						app.getNotice();
					}
				}
			}
		});
    </script>
</body>

</html>